home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_input_hidden.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-04-09  |  4.1 KB  |  84 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="380" height="310" caption="Hidden text field">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.             <label name="lblName" caption="Name" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance. This field is required." width="29" height="13" top="8" left="8"/>
  6.             <label name="lblValue" caption="Text/value" hint="Text/value of your form element." width="69" height="13" top="8" left="192"/>
  7.             <edit name="edtName" taborder="0" text="" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance. This field is required." width="169" height="19" top="24" left="8"/>
  8.             <edit name="edtValue" taborder="1" text="" hint="Text/value of your form element." width="161" height="19" top="24" left="192"/>
  9.             <checkbox name="cbDisabled" caption="Disabled" taborder="2" hint="Your element will be visible, but disabled." checked="0" width="121" height="17" top="56" left="8"/>
  10.         </panel>
  11.     </controls>
  12.     <dialogevents>
  13.         <event type="onclose" resulttype="ok">
  14.             StartCode := '<input type="hidden"';
  15.             If edtName.Text <> '' then
  16.              StartCode := Startcode + ' name="'+(edtName.Text)+'"';
  17.             If edtValue.Text > '' then
  18.              StartCode := Startcode + ' value="'+(edtValue.Text)+'"';
  19.             if cbDisabled.Checked then
  20.               StartCode := Startcode + ' disabled';
  21.   
  22.               If edtCSSClass.Text <> '' then
  23.              StartCode := StartCode + ' class="'+edtCSSClass.Text+'"';
  24.               If edtCSSId.Text <> '' then
  25.                StartCode := StartCode + ' ID="'+edtCSSId.Text+'"';
  26.               If edtCSSStyle.Text <> '' then
  27.                StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"';
  28.             for i := 0 to EventGrid.Count - 1 do
  29.               begin
  30.               if EventGrid.Rows[i].EditText <> '' then
  31.                StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  32.              end;    
  33.  
  34.             StartCode := StartCode + '>';
  35.             If cbMakeXHTMLCompliant.Checked then
  36.              StartCode := MakeXHTMLCompliant(StartCode, false);
  37.             If cbDoPHPEscape.Checked then
  38.              StartCode := DoPHPEscape(StartCode);         
  39.             // A little "hack" - WebCoder will set this, to let us know whether to update
  40.             // an existing tag, or insert a brand new one
  41.             If cbUpdateExistingTag.Checked then 
  42.              ReplaceTag(StartCode)
  43.             else 
  44.                InsertTags(StartCode, '');   
  45.               
  46.         </event>
  47.         <event type="onshow">    
  48.             // Lets put the advanced panel in the right place
  49.             pnlAdvanced.Parent := MainPanel;
  50.             pnlAdvanced.Left := 8;
  51.             pnlAdvanced.Top := MainPanel.Height - 32;        
  52.             pnlAdvanced.Width := Self.Width - 36;
  53.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  54.             If pnlAdvanced.Height > 20 then
  55.              Self.Height := Self.Height + 200;
  56.         </event>
  57.         <event type="updatedialog">
  58.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  59.             // The entire selected tag will be passed as a parameter to this function, that should update
  60.             // the required fields of the dialog.
  61.             function UpdateDialog(Tag: string);
  62.              begin
  63.             
  64.               edtName.Text := GetValueFromAttribute(Tag, 'name');
  65.               edtValue.Text := GetValueFromAttribute(Tag, 'value');
  66.               
  67.               cbDisabled.Checked := HasOption(Tag, 'disabled'); 
  68.             
  69.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  70.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  71.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  72.               for i := 0 to EventGrid.Count - 1 do
  73.                 begin
  74.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  75.                  If EventVal <> '' then
  76.                   EventGrid.Rows[i].EditText := EventVal;
  77.                end;  
  78.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  79.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();                            
  80.              end;
  81.         </event>
  82.     </dialogevents>
  83. </dialog>
  84.